package com.yunze.apiCommon.upstreamAPI.YiChe.Inquire;


import com.alibaba.fastjson.JSON;
import com.yunze.apiCommon.upstreamAPI.DianXinCMP5G.SignUtil;
import com.yunze.apiCommon.upstreamAPI.YiChe.YiChe_Api;
import com.yunze.apiCommon.utils.HttpUtil;
import com.yunze.apiCommon.utils.VeDate;

import java.util.HashMap;
import java.util.Map;
import java.util.Random;

/**
 * 查询类接口
 */
public class Query_YiChe extends YiChe_Api {

    public static void main(String[] args) {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("cd_username", "t4ukswDI8EKU2xqWbFfwUaNUTMwd4a7Z");//
        map.put("cd_pwd", "802708d6b67d4542acf5f6102114351c,2");//
        map.put("cd_key", "http://card.eacher-iot.com");//

        Query_YiChe Qy = new Query_YiChe(map);

        for (int i = 0; i < 1; i++) {
            System.out.println(Qy.getCardsInfo("898604B3192290023419"));
        }

    }


    public Query_YiChe(Map<String, Object> init_map) {
        super(init_map);
    }


    /**
     * 获取单个卡的流量
     * @param iccid iccid
     * @param
     * @return
     */
    public static String getCardsInfo(String iccid) {
        String Rstr = null;
        try {
            String url = server_Ip + "/card/getCardsInfo";
            params.put("iccid",iccid);
            params.put("operator",operator);

            params.put("sign",generateSign(params));
            Rstr = HttpUtil.sendPostJson(url, JSON.toJSONString(params));
        } catch (Exception e) {
            e.printStackTrace();
        }
        return Rstr;
    }


    /**
     * 获取在线信息
     * @param iccid
     * @return
     */
    public static String queryCardOnlineStatusInfo(String iccid) {
        String Rstr = null;
        try {
            String url = server_Ip + "/outputApi/queryCardOnlineStatusInfo";
            params.put("iccid",iccid);
            params.put("operator",operator);

            params.put("sign",generateSign(params));
            Rstr = HttpUtil.sendPostJson(url, JSON.toJSONString(params));
        } catch (Exception e) {
            e.printStackTrace();
        }
        return Rstr;
    }






}
